package com.dd.common.strategy;

import com.dd.common.strategy.FileStrategy;
import com.dd.pojo.query.UserFileQuery;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;

@Component
public class FileStrategyManage {

    @Resource
    private List<FileStrategy>fileStrategies;
    public boolean checkFile(UserFileQuery checkFileIndex){
        for(FileStrategy strategy:fileStrategies){
            boolean resu=strategy.checkFileUpload(checkFileIndex);
            if(!resu){
                return  false;}
        }
        return  true;
    }
}
